home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 272_01 / onexit.doc < prev    next >
Text File  |  1987-07-15  |  1KB  |  45 lines

  1.  
  2.  
  3.         NAME
  4.                 onexit -- install a common exit routine
  5.  
  6.         SYNOPSIS
  7.                 void onexit(addr);
  8.                 int *addr;      address of function to call
  9.  
  10.  
  11.  
  12.         DESCRIPTION
  13.         This function is used to install a function into the
  14.         common_exit routine.  It may be used to provide a means
  15.         of insuring that one or more operations are performed before
  16.         a program exit.  Note that the installed routine is ONLY
  17.         called if common_exit() is called to invoke it.  Doing
  18.         a standard exit() will NOT call the installed routine.
  19.  
  20.  
  21.         EXAMPLE
  22.  
  23.              int ticks;
  24.  
  25.              main() {
  26.                    installtick(&ticks);  /* install realtime counter */
  27.                    onexit(&removetick);  /* insure it is uninstalled later */
  28.                           ..
  29.                           ..
  30.                           ..
  31.                     aabort();            /* this will invoke removetick() */
  32.                     }
  33.  
  34.         N.B.:
  35.             Any function in this Library which does an exit will
  36.             call common_exit.   This includes (but may not be limited to):
  37.                 error()      aabort()       badext()
  38.                 eraok()      exit2dos()     cant()
  39.  
  40.  
  41.  
  42.  
  43.  
  44.         This function is found in SMDLx.LIB for the Datalight Compiler.
  45.